//
//  CommonUploadSolaImageView.m
//  DouLinBusiness
//
//  Created by ypj on 2021/4/12.
//

#import "CommonUploadSolaImageView.h"
@interface CommonUploadSolaImageView ()

@end
@implementation CommonUploadSolaImageView
-(instancetype)initWithFrame:(CGRect)frame withSectionTitle:(NSString *)titleString
{
    self=[super initWithFrame:frame];
    if (self) {
         self.titleString=titleString;
        [self createUI];
       
    }
    return self;
}
-(void)createUI{
    
    self.backgroundColor=[UIColor whiteColor];
    self.titleNameLb=[[UILabel alloc] initWithFrame:CGRectMake(15, 8, ScreenWidth-30, 18)];
    self.titleNameLb.textColor=Black_1A1A1A;
    self.titleNameLb.text=self.titleString;
    self.titleNameLb.font=[UIFont systemFontOfSize:15.0];
   [self addSubview:self.titleNameLb];
    
    self.reUpdateImage=[UIButton buttonWithType:UIButtonTypeCustom];
    self.reUpdateImage.frame=CGRectMake(ScreenWidth-85, 8, 70, 18);
    [self.reUpdateImage setTitle:@"重新上传" forState:UIControlStateNormal];
    self.reUpdateImage.titleLabel.font=[UIFont systemFontOfSize:12.0];
    [self.reUpdateImage createBordersWithColor:gray808080_color withCornerRadius:9.0 andWidth:0.5];
    [self.reUpdateImage setTitleColor:gray808080_color forState:UIControlStateNormal];
    [self.reUpdateImage  addTarget:self action:@selector(reUploadImageClick) forControlEvents:UIControlEventTouchUpInside];
    self.reUpdateImage.hidden=YES;
    [self addSubview:_reUpdateImage];
    
    self.zhuShiLb=[[UILabel alloc] initWithFrame:CGRectMake(15, self.titleNameLb.bottom+8, ScreenWidth-30, 15)];
    self.zhuShiLb.textColor=gray808080_color;
    self.zhuShiLb.text=@"单张最大不超过512k";
    self.zhuShiLb.font=[UIFont systemFontOfSize:9.0];
    [self addSubview:self.zhuShiLb];
    
    self.imageButton=[UIButton buttonWithType:UIButtonTypeCustom];
    self.imageButton.frame=CGRectMake(30, self.zhuShiLb.bottom+10, 80, 80);
    [self.imageButton addTarget:self action:@selector(imageButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [self.imageButton setImage:[UIImage imageNamed:@"addImage_icon"] forState:UIControlStateNormal];
    [self addSubview:_imageButton];

}
-(void)reUploadImageClick{
    self.ToShowAlert();
}
-(void)imageButtonClick{
    self.ToShowAlert();
}
@end
